package com.breeze.breezelive.record;

public class LiveManager {
    public static LiveManager instance = null;
    private MediaMuxerThread mediaMuxerThread;
    private boolean isPrepared;

    private LiveManager() {

    }

    public static LiveManager getInstance() {
        if (instance == null) {
            return new LiveManager();
        }
        return instance;
    }

    public void prepare(String path) {
        mediaMuxerThread = new MediaMuxerThread(path);
        isPrepared = true;
    }

    public void start(int width, int height) {
        mediaMuxerThread.begin(width, height);
    }

    public void stop() {
        mediaMuxerThread.end();
    }


    public void frame(byte[] data) {
        if (isPrepared) {
            mediaMuxerThread.frame(data);
        }
    }

    public void release() {
    }
}
